namespace Pp.Dto.Validators
{
    using System.ComponentModel.DataAnnotations;
    using Globalization;

    public class MaxLengthValidator : StringLengthAttribute
    {
        public MaxLengthValidator(int maxSize)
            : base(maxSize)
        {
            ErrorMessage = string.Format(Res.Format_LengthError, maxSize);
        }
        public MaxLengthValidator(int maxSize,int minSize)
            : base(maxSize)
        {
            MinimumLength = minSize;
            ErrorMessage = string.Format(Res.Format_MaxMinLengthError, maxSize, minSize);
        }
        public MaxLengthValidator()
            : base(75)
        {
            ErrorMessage = string.Format(Res.Format_LengthError, 70);
        }
    }
}